Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 'release/6.6' into 'develop' #507

Merged
merged 7 commits into from
Jan 1, 2025
Merged

Conversation

FantasyTeddy
Copy link
Collaborator

No description provided.


namespace AgIO
{
public static class Log
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You dropped the prefix 'C' from the class name. That's perfectly fine for me since it does not add anything in my opinion.
Please change the file name accordingly.

@@ -516,14 +516,14 @@ public void GetCurrentCurveLine(vec3 pivot, vec3 steer)
else// Pure Pursuit ------------------------------------------
{

double minDistA = double.MaxValue;
double minDistB = double.MaxValue;
double minDistA;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scope of these variables is too big. Move them inside the if.

{
StringBuilder sbF = new StringBuilder();
long bytes = txtfile.Length - sizeLimit;
bytes = (sizeLimit *2)/10 + bytes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use spaces around operators

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't undestand what the calculation is about. Please add comment line or improve naming of variables if that helps.

{
bytesSoFar += reader.ReadLine().Length;
if (bytesSoFar > bytes)
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many coding standards forbid single line if statements like this. Either use {} or put the break on the same line as the if.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only comment I slightly disagree with: Yes, using brackets ({}) is probably the best way to format this, but if single-line if statements can be used, I don't think it matters if the same-line or the 2-line version is used (they are equally good/bad).

@@ -461,7 +460,7 @@ private void btnBuildFields_Click(object sender, EventArgs e)
}
catch (Exception ed)
{
mf.LogEventWriter("Creating new iso field " + ed.ToString());
Log.EventWriter("Creating new iso field " + ed.ToString());

MessageBox.Show(gStr.gsError, ed.ToString());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that most occurences of Messageboxes for errors also need a Log.EventWriter. In the future we could make an dedicated ErrorMessageBox that takes care of both the eventLog and the window.

}

//get the fields directory, if not exist, create
logsDirectory = Path.Combine(baseDirectory, "Logs");
if (!string.IsNullOrEmpty(logsDirectory) && !Directory.Exists(logsDirectory)) { Directory.CreateDirectory(logsDirectory);
sbSystemEvents.Append("Logs Dir Created\r");
Log.sbEvents.Append("Logs Dir Created\r");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see so many \r in the calling code. Maybe we could make that the resposibility of the logging class in the future

@FantasyTeddy
Copy link
Collaborator Author

FantasyTeddy commented Jan 1, 2025

Sorry, these are all valid inputs, but this PR is only the merge of the release branch (release/6.6) into develop and I'm discarding all the changes, because they are already in develop.

Maybe we can add your proposed changes in a different PR directly to develop?

FileInfo txtfile = new FileInfo(Path.Combine(logsDirectory, "zSystemEventsLog_log.txt"));
if (txtfile.Exists)
{
if (txtfile.Length > (500000)) // ## NOTE: 0.5MB max file size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the additional () around 500000. I would prefer to write (512 * 1024), because that is the acutal number for 0.5MB and you don't need to count the zero's when checking the code.

@J005t67
Copy link
Contributor

J005t67 commented Jan 1, 2025

Sorry, these are all valid inputs, but this PR is only the merge of the release branch (release/6.6) into develop and I'm discarding all the changes, because they are already in develop.

Maybe we can add your proposed changes in a different PR directly to develop?

Yes, you are right, this PR is only about the merge. Please ignore my comments.
I think I was so enthusiastic about our new reviewing proces that I overdid it a bit ;-)

@FantasyTeddy
Copy link
Collaborator Author

I think I was so enthusiastic about our new reviewing proces that I overdid it a bit ;-)

I totally understand and I really appreciate the comments. Maybe @farmerbriantee can incorporate these suggestions in a future PR?

Copy link
Contributor

@J005t67 J005t67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels good to start 2025 with a new review process!
Did not spot any merge problems.

@FantasyTeddy FantasyTeddy merged commit c667287 into develop Jan 1, 2025
1 check passed
@FantasyTeddy FantasyTeddy deleted the merge-release-branch branch January 1, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants